wayland: Ensure we re-request the target if the fd changes
authorCarlos Garnacho <carlosg@gnome.org>
Thu, 19 Mar 2015 14:54:48 +0000 (15:54 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Thu, 19 Mar 2015 15:05:04 +0000 (16:05 +0100)
If we receive wl_data_source.target before .send, the target would already
be cached, but we'd take no action on the new fd.

gdk/wayland/gdkselection-wayland.c

index 4ba016a8ce0432dd7e3849ca62f3c23530e24ee8..043ca7d6df0c74a79a8700115165498387d11546 100644 (file)
@@ -558,12 +558,12 @@ gdk_wayland_selection_request_target (GdkWaylandSelection *wayland_selection,
   else
     return FALSE;
 
-  if (fd >= 0)
-    wayland_selection->stored_selection.fd = fd;
-
-  if (wayland_selection->source_requested_target == target)
+  if (wayland_selection->stored_selection.fd == fd &&
+      wayland_selection->source_requested_target == target)
     return FALSE;
 
+  wayland_selection->stored_selection.fd = fd;
+
   wayland_selection->source_requested_target = target;
 
   if (window && target != GDK_NONE)